using System;
using System.Data;
using System.Text;
using System.Text.RegularExpressions;

using Wicresoft.Common;
using Wicresoft.Busi.Entity;

namespace Wicresoft.Busi.BizLogic
{
    /// <summary>
    /// Summary description for BLMeetingRoomGroups.
    /// </summary>
    public class BLMeetingRoomGroups
    {
        public BLMeetingRoomGroups()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public static bool DelMeetingRoomGroups(int RoomID)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(MeetingRoomGroups.SQLCOL_ROOMID + " = " + RoomID);
            return DataAccess.Delete(typeof(MeetingRoomGroups), sb.ToString());
        }

        public static DataTable GetMeetingRoomGroups(int RoomID)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(MeetingRoomGroups.SQLCOL_ROOMID + " = " + RoomID);
            return DataAccess.Select(typeof(MeetingRoomGroups), sb.ToString(), MeetingRoomGroups.SQLCOL_ID);
        }

        public static DataTable GetMeetingRoomGroups(Guid GroupID)
        {
            return DataAccess.Select(typeof(MeetingRoomGroups), Entity.MeetingRoomGroups.SQLCOL_GROUPID + " = '" + GroupID +"'", string.Empty);
        }
        //		public static void AddMeetingRoomGroups(string groupID, string groupDisplayName, int roomID)
        //		{
        //			Regex r = new Regex(";");
        //			string[]groupNames = r.Split(groupDisplayName);
        //			string[]groupIDs = r.Split(groupID);
        //			for(int i = groupNames.Length - 1; i >= 0; i--)
        //			{
        //				Wicresoft.Busi.Entity.MeetingRoomGroups info = new MeetingRoomGroups();
        //				info.RoomID = roomID;
        //				info.GroupName = groupNames[i];
        //				info.GroupID = int.Parse(groupIDs[i]);
        //				info.Add();
        //			}			
        //		}
    }
}
